﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WestWorldRemake.Messaging;

namespace WestWorldRemake
{
    public abstract class BaseGameEntity
    {
        private int NextValidID = 0;
        private int _ID;
        private string _name;
        private ConsoleColor _color;
        private void SetID(BaseGameEntity obj)
        {
            obj._ID = NextValidID;
            NextValidID++;
        }

        private BaseGameEntity() {
            SetID(this);
        }
        public BaseGameEntity(string name)
        {
            SetID(this);
            this._name = name;
            this._color = ConsoleColor.White;
        }
        public BaseGameEntity(string name, ConsoleColor color)
        {
            SetID(this);
            this._name = name;
            this._color = color;
        }
        public int ID
        {
            get
            {
                return _ID;
            }
        }
        public string name
        {
            get
            {
                return _name;
            }
        }
        public ConsoleColor Color
        {
            get
            {
                return _color;
            }
        }
        public abstract Iffy HandleMessage(Telegram message);

        public virtual void Update() { }
        public override string ToString()
        {
            return this._name;
        }
    }
}
